/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package dale2507.gates.configurator.ui.components;

import java.util.ArrayList;
import org.bukkit.Material;

/**
 *
 * @author Dale
 */
public class BlockSelector extends MaterialSelector {
    
    public BlockSelector() {
        this(new Material[0]);
    }

    public BlockSelector(Material[] material) {
        if (material == null || material.length == 0) {
            ArrayList<Material> materials = new ArrayList<>();
            for (Material m : Material.values()) {
                if (m.isBlock()) {
                    materials.add(m);
                }
            }
            material = materials.toArray(new Material[0]);
        }
        
        this.setMaterials(material);
    }
    
}
